package main

import (
	"sbd_zgqx/handler"
	"sbd_zgqx/inits"
	"sbd_zgqx/reposit"
	"sbd_zgqx/service"
)

var (
	ProvinceHandler handler.ProvinceHandler
	WeatherHandler  handler.WeatherHandler

	// HostHandler ws.HostHandler
)

func init() {
	if err := inits.Init(""); err != nil {
		panic(err)
	}
	DB := inits.NewDatabase

	ProvinceHandler = handler.ProvinceHandler{
		ProvinceSrv: service.ProvinceService{
			Repo: reposit.ProvinceReposit{
				Db: DB(),
			},
		},
	}
	WeatherHandler = handler.WeatherHandler{
		WeatherSrv: service.WeatherService{
			Repo: reposit.WeatherReposit{
				Db: DB(),
			},
		},
	}

}
